package bai.myworld.controller.Shop;

import bai.myworld.common.utils.Result;
import bai.myworld.pojo.entity.shop.Product;
import bai.myworld.pojo.entity.shop.ProductSku;
import bai.myworld.pojo.entity.shop.ProductSpecification;
import bai.myworld.pojo.vo.shop.ProductDetailVO;
import bai.myworld.pojo.vo.shop.ProductSkuVO;
import bai.myworld.service.impl.Shop.ProductService;
import lombok.RequiredArgsConstructor;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping("/shop/products")
@RequiredArgsConstructor
public class ProductController {
    @Autowired
    private ProductService productService;

    @GetMapping("/{id}")
    public Result<ProductDetailVO> getDetail(@PathVariable Long id) {
        return Result.success(productService.getProductDetail(id));
    }

}
